import { _decorator, Component, Camera, Color, Vec3 } from 'cc';
const { ccclass, property, executeInEditMode } = _decorator;

@ccclass('Geometry')
@executeInEditMode(true)
export class Geometry extends Component {

    @property(Camera)
    mainCamera: Camera = null;

    start() {
        this.mainCamera?.camera.initGeometryRenderer();
    }

    update(deltaTime: number) {
        this.mainCamera?.camera?.geometryRenderer?.addLine(this.node.worldPosition, new Vec3(0, 0, 0), Color.GREEN, true)
    }
}